<?php


abstract class BaseChallenge extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $p1_id;


	
	protected $p2_id;


	
	protected $p1_rank;


	
	protected $p2_rank;


	
	protected $p1_points;


	
	protected $p2_points;


	
	protected $killmail_id;


	
	protected $created_at;


	
	protected $is_valid;


	
	protected $validation_dt;


	
	protected $is_refused;


	
	protected $refused_at;


	
	protected $reason;


	
	protected $is_draw;

	
	protected $asfGuardUserRelatedByP1Id;

	
	protected $asfGuardUserRelatedByP2Id;

	
	protected $aKillmail;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getP1Id()
	{

		return $this->p1_id;
	}

	
	public function getP2Id()
	{

		return $this->p2_id;
	}

	
	public function getP1Rank()
	{

		return $this->p1_rank;
	}

	
	public function getP2Rank()
	{

		return $this->p2_rank;
	}

	
	public function getP1Points()
	{

		return $this->p1_points;
	}

	
	public function getP2Points()
	{

		return $this->p2_points;
	}

	
	public function getKillmailId()
	{

		return $this->killmail_id;
	}

	
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->created_at === null || $this->created_at === '') {
			return null;
		} elseif (!is_int($this->created_at)) {
						$ts = strtotime($this->created_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
			}
		} else {
			$ts = $this->created_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getIsValid()
	{

		return $this->is_valid;
	}

	
	public function getValidationDt($format = 'Y-m-d')
	{

		if ($this->validation_dt === null || $this->validation_dt === '') {
			return null;
		} elseif (!is_int($this->validation_dt)) {
						$ts = strtotime($this->validation_dt);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [validation_dt] as date/time value: " . var_export($this->validation_dt, true));
			}
		} else {
			$ts = $this->validation_dt;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getIsRefused()
	{

		return $this->is_refused;
	}

	
	public function getRefusedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->refused_at === null || $this->refused_at === '') {
			return null;
		} elseif (!is_int($this->refused_at)) {
						$ts = strtotime($this->refused_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [refused_at] as date/time value: " . var_export($this->refused_at, true));
			}
		} else {
			$ts = $this->refused_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getReason()
	{

		return $this->reason;
	}

	
	public function getIsDraw()
	{

		return $this->is_draw;
	}

	
	public function setId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = ChallengePeer::ID;
		}

	} 
	
	public function setP1Id($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->p1_id !== $v) {
			$this->p1_id = $v;
			$this->modifiedColumns[] = ChallengePeer::P1_ID;
		}

		if ($this->asfGuardUserRelatedByP1Id !== null && $this->asfGuardUserRelatedByP1Id->getId() !== $v) {
			$this->asfGuardUserRelatedByP1Id = null;
		}

	} 
	
	public function setP2Id($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->p2_id !== $v) {
			$this->p2_id = $v;
			$this->modifiedColumns[] = ChallengePeer::P2_ID;
		}

		if ($this->asfGuardUserRelatedByP2Id !== null && $this->asfGuardUserRelatedByP2Id->getId() !== $v) {
			$this->asfGuardUserRelatedByP2Id = null;
		}

	} 
	
	public function setP1Rank($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->p1_rank !== $v) {
			$this->p1_rank = $v;
			$this->modifiedColumns[] = ChallengePeer::P1_RANK;
		}

	} 
	
	public function setP2Rank($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->p2_rank !== $v) {
			$this->p2_rank = $v;
			$this->modifiedColumns[] = ChallengePeer::P2_RANK;
		}

	} 
	
	public function setP1Points($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->p1_points !== $v) {
			$this->p1_points = $v;
			$this->modifiedColumns[] = ChallengePeer::P1_POINTS;
		}

	} 
	
	public function setP2Points($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->p2_points !== $v) {
			$this->p2_points = $v;
			$this->modifiedColumns[] = ChallengePeer::P2_POINTS;
		}

	} 
	
	public function setKillmailId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->killmail_id !== $v) {
			$this->killmail_id = $v;
			$this->modifiedColumns[] = ChallengePeer::KILLMAIL_ID;
		}

		if ($this->aKillmail !== null && $this->aKillmail->getId() !== $v) {
			$this->aKillmail = null;
		}

	} 
	
	public function setCreatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_at !== $ts) {
			$this->created_at = $ts;
			$this->modifiedColumns[] = ChallengePeer::CREATED_AT;
		}

	} 
	
	public function setIsValid($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->is_valid !== $v) {
			$this->is_valid = $v;
			$this->modifiedColumns[] = ChallengePeer::IS_VALID;
		}

	} 
	
	public function setValidationDt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [validation_dt] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->validation_dt !== $ts) {
			$this->validation_dt = $ts;
			$this->modifiedColumns[] = ChallengePeer::VALIDATION_DT;
		}

	} 
	
	public function setIsRefused($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->is_refused !== $v) {
			$this->is_refused = $v;
			$this->modifiedColumns[] = ChallengePeer::IS_REFUSED;
		}

	} 
	
	public function setRefusedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [refused_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->refused_at !== $ts) {
			$this->refused_at = $ts;
			$this->modifiedColumns[] = ChallengePeer::REFUSED_AT;
		}

	} 
	
	public function setReason($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->reason !== $v) {
			$this->reason = $v;
			$this->modifiedColumns[] = ChallengePeer::REASON;
		}

	} 
	
	public function setIsDraw($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->is_draw !== $v) {
			$this->is_draw = $v;
			$this->modifiedColumns[] = ChallengePeer::IS_DRAW;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->p1_id = $rs->getInt($startcol + 1);

			$this->p2_id = $rs->getInt($startcol + 2);

			$this->p1_rank = $rs->getInt($startcol + 3);

			$this->p2_rank = $rs->getInt($startcol + 4);

			$this->p1_points = $rs->getInt($startcol + 5);

			$this->p2_points = $rs->getInt($startcol + 6);

			$this->killmail_id = $rs->getInt($startcol + 7);

			$this->created_at = $rs->getTimestamp($startcol + 8, null);

			$this->is_valid = $rs->getInt($startcol + 9);

			$this->validation_dt = $rs->getDate($startcol + 10, null);

			$this->is_refused = $rs->getInt($startcol + 11);

			$this->refused_at = $rs->getTimestamp($startcol + 12, null);

			$this->reason = $rs->getString($startcol + 13);

			$this->is_draw = $rs->getInt($startcol + 14);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 15; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Challenge object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(ChallengePeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			ChallengePeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(ChallengePeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(ChallengePeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->asfGuardUserRelatedByP1Id !== null) {
				if ($this->asfGuardUserRelatedByP1Id->isModified()) {
					$affectedRows += $this->asfGuardUserRelatedByP1Id->save($con);
				}
				$this->setsfGuardUserRelatedByP1Id($this->asfGuardUserRelatedByP1Id);
			}

			if ($this->asfGuardUserRelatedByP2Id !== null) {
				if ($this->asfGuardUserRelatedByP2Id->isModified()) {
					$affectedRows += $this->asfGuardUserRelatedByP2Id->save($con);
				}
				$this->setsfGuardUserRelatedByP2Id($this->asfGuardUserRelatedByP2Id);
			}

			if ($this->aKillmail !== null) {
				if ($this->aKillmail->isModified()) {
					$affectedRows += $this->aKillmail->save($con);
				}
				$this->setKillmail($this->aKillmail);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = ChallengePeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += ChallengePeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->asfGuardUserRelatedByP1Id !== null) {
				if (!$this->asfGuardUserRelatedByP1Id->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->asfGuardUserRelatedByP1Id->getValidationFailures());
				}
			}

			if ($this->asfGuardUserRelatedByP2Id !== null) {
				if (!$this->asfGuardUserRelatedByP2Id->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->asfGuardUserRelatedByP2Id->getValidationFailures());
				}
			}

			if ($this->aKillmail !== null) {
				if (!$this->aKillmail->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aKillmail->getValidationFailures());
				}
			}


			if (($retval = ChallengePeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = ChallengePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getP1Id();
				break;
			case 2:
				return $this->getP2Id();
				break;
			case 3:
				return $this->getP1Rank();
				break;
			case 4:
				return $this->getP2Rank();
				break;
			case 5:
				return $this->getP1Points();
				break;
			case 6:
				return $this->getP2Points();
				break;
			case 7:
				return $this->getKillmailId();
				break;
			case 8:
				return $this->getCreatedAt();
				break;
			case 9:
				return $this->getIsValid();
				break;
			case 10:
				return $this->getValidationDt();
				break;
			case 11:
				return $this->getIsRefused();
				break;
			case 12:
				return $this->getRefusedAt();
				break;
			case 13:
				return $this->getReason();
				break;
			case 14:
				return $this->getIsDraw();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = ChallengePeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getP1Id(),
			$keys[2] => $this->getP2Id(),
			$keys[3] => $this->getP1Rank(),
			$keys[4] => $this->getP2Rank(),
			$keys[5] => $this->getP1Points(),
			$keys[6] => $this->getP2Points(),
			$keys[7] => $this->getKillmailId(),
			$keys[8] => $this->getCreatedAt(),
			$keys[9] => $this->getIsValid(),
			$keys[10] => $this->getValidationDt(),
			$keys[11] => $this->getIsRefused(),
			$keys[12] => $this->getRefusedAt(),
			$keys[13] => $this->getReason(),
			$keys[14] => $this->getIsDraw(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = ChallengePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setP1Id($value);
				break;
			case 2:
				$this->setP2Id($value);
				break;
			case 3:
				$this->setP1Rank($value);
				break;
			case 4:
				$this->setP2Rank($value);
				break;
			case 5:
				$this->setP1Points($value);
				break;
			case 6:
				$this->setP2Points($value);
				break;
			case 7:
				$this->setKillmailId($value);
				break;
			case 8:
				$this->setCreatedAt($value);
				break;
			case 9:
				$this->setIsValid($value);
				break;
			case 10:
				$this->setValidationDt($value);
				break;
			case 11:
				$this->setIsRefused($value);
				break;
			case 12:
				$this->setRefusedAt($value);
				break;
			case 13:
				$this->setReason($value);
				break;
			case 14:
				$this->setIsDraw($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = ChallengePeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setP1Id($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setP2Id($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setP1Rank($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setP2Rank($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setP1Points($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setP2Points($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setKillmailId($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setCreatedAt($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setIsValid($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setValidationDt($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setIsRefused($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setRefusedAt($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setReason($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setIsDraw($arr[$keys[14]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(ChallengePeer::DATABASE_NAME);

		if ($this->isColumnModified(ChallengePeer::ID)) $criteria->add(ChallengePeer::ID, $this->id);
		if ($this->isColumnModified(ChallengePeer::P1_ID)) $criteria->add(ChallengePeer::P1_ID, $this->p1_id);
		if ($this->isColumnModified(ChallengePeer::P2_ID)) $criteria->add(ChallengePeer::P2_ID, $this->p2_id);
		if ($this->isColumnModified(ChallengePeer::P1_RANK)) $criteria->add(ChallengePeer::P1_RANK, $this->p1_rank);
		if ($this->isColumnModified(ChallengePeer::P2_RANK)) $criteria->add(ChallengePeer::P2_RANK, $this->p2_rank);
		if ($this->isColumnModified(ChallengePeer::P1_POINTS)) $criteria->add(ChallengePeer::P1_POINTS, $this->p1_points);
		if ($this->isColumnModified(ChallengePeer::P2_POINTS)) $criteria->add(ChallengePeer::P2_POINTS, $this->p2_points);
		if ($this->isColumnModified(ChallengePeer::KILLMAIL_ID)) $criteria->add(ChallengePeer::KILLMAIL_ID, $this->killmail_id);
		if ($this->isColumnModified(ChallengePeer::CREATED_AT)) $criteria->add(ChallengePeer::CREATED_AT, $this->created_at);
		if ($this->isColumnModified(ChallengePeer::IS_VALID)) $criteria->add(ChallengePeer::IS_VALID, $this->is_valid);
		if ($this->isColumnModified(ChallengePeer::VALIDATION_DT)) $criteria->add(ChallengePeer::VALIDATION_DT, $this->validation_dt);
		if ($this->isColumnModified(ChallengePeer::IS_REFUSED)) $criteria->add(ChallengePeer::IS_REFUSED, $this->is_refused);
		if ($this->isColumnModified(ChallengePeer::REFUSED_AT)) $criteria->add(ChallengePeer::REFUSED_AT, $this->refused_at);
		if ($this->isColumnModified(ChallengePeer::REASON)) $criteria->add(ChallengePeer::REASON, $this->reason);
		if ($this->isColumnModified(ChallengePeer::IS_DRAW)) $criteria->add(ChallengePeer::IS_DRAW, $this->is_draw);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(ChallengePeer::DATABASE_NAME);

		$criteria->add(ChallengePeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setP1Id($this->p1_id);

		$copyObj->setP2Id($this->p2_id);

		$copyObj->setP1Rank($this->p1_rank);

		$copyObj->setP2Rank($this->p2_rank);

		$copyObj->setP1Points($this->p1_points);

		$copyObj->setP2Points($this->p2_points);

		$copyObj->setKillmailId($this->killmail_id);

		$copyObj->setCreatedAt($this->created_at);

		$copyObj->setIsValid($this->is_valid);

		$copyObj->setValidationDt($this->validation_dt);

		$copyObj->setIsRefused($this->is_refused);

		$copyObj->setRefusedAt($this->refused_at);

		$copyObj->setReason($this->reason);

		$copyObj->setIsDraw($this->is_draw);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new ChallengePeer();
		}
		return self::$peer;
	}

	
	public function setsfGuardUserRelatedByP1Id($v)
	{


		if ($v === null) {
			$this->setP1Id(NULL);
		} else {
			$this->setP1Id($v->getId());
		}


		$this->asfGuardUserRelatedByP1Id = $v;
	}


	
	public function getsfGuardUserRelatedByP1Id($con = null)
	{
		if ($this->asfGuardUserRelatedByP1Id === null && ($this->p1_id !== null)) {
						include_once 'plugins/sfGuardPlugin/lib/model/om/BasesfGuardUserPeer.php';

			$this->asfGuardUserRelatedByP1Id = sfGuardUserPeer::retrieveByPK($this->p1_id, $con);

			
		}
		return $this->asfGuardUserRelatedByP1Id;
	}

	
	public function setsfGuardUserRelatedByP2Id($v)
	{


		if ($v === null) {
			$this->setP2Id(NULL);
		} else {
			$this->setP2Id($v->getId());
		}


		$this->asfGuardUserRelatedByP2Id = $v;
	}


	
	public function getsfGuardUserRelatedByP2Id($con = null)
	{
		if ($this->asfGuardUserRelatedByP2Id === null && ($this->p2_id !== null)) {
						include_once 'plugins/sfGuardPlugin/lib/model/om/BasesfGuardUserPeer.php';

			$this->asfGuardUserRelatedByP2Id = sfGuardUserPeer::retrieveByPK($this->p2_id, $con);

			
		}
		return $this->asfGuardUserRelatedByP2Id;
	}

	
	public function setKillmail($v)
	{


		if ($v === null) {
			$this->setKillmailId(NULL);
		} else {
			$this->setKillmailId($v->getId());
		}


		$this->aKillmail = $v;
	}


	
	public function getKillmail($con = null)
	{
		if ($this->aKillmail === null && ($this->killmail_id !== null)) {
						include_once 'lib/model/om/BaseKillmailPeer.php';

			$this->aKillmail = KillmailPeer::retrieveByPK($this->killmail_id, $con);

			
		}
		return $this->aKillmail;
	}

} 